package com.greate.community.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import javax.annotation.PostConstruct;

@Data
@Slf4j
@Configuration
public class AppConfig {

    public static String env;

    private final Environment environment;

    public AppConfig(Environment environment) {
        this.environment = environment;
    }

    @PostConstruct
    public void init() {
        env=environment.getProperty("spring.profiles.active");
        log.info("spring.profiles.active: {}", env);
    }
}
